home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacHack 1997
/
MacHack 1997.toast
/
Hacks
/
Hacks ’96
/
PredatorPrey
/
pred_prey_hndl.c
next >
Wrap
Text File
|
1996-06-22
|
3KB
|
83 lines
PredDataHndl pred_hndl;
PreyDataHndl prey_hndl;
pred_hndl = (PredDataHndl)NewHandle(sizeof(pred_data));
prey_hndl = (PreyDataHndl)NewHandle(sizeof(prey_data));
/****************************************************/
typedef struct
{
objectDescr object[1];
short type;
Boolean hasBackGround;
Boolean isArmed;
short targets_left;
short armament_type; /* 0 = guns, 1 = guns & missles, 2 = guns, missles & neutron bomb */
short arms_selected; /* 0 = guns, 1 = missles, 2 = neutron bomb */
Boolean hasTargets;
} pred_data, prey_data, **PredDataHndl, **PreyDataHndl;
/****************************************************/
typedef struct
{
Rect bounds; /* obj_rect */
short type; /* objType */
short missles;
Boolean selected;
Boolean armed;
struct _3dPtStrk _3dPtH[22]; /* creation coordinates */
struct _3dPtStrk _3dPt[22];
struct rotstruk rotHist[4][4];
struct msStruct mStruct[14];
struct sndStruct sndStruct[10];
PolyHandle thePoly[6];
PixPatHandle thePPat[6];
} objectDescr;
/****************************************************/
typedef struct /** contains info needed to specify each window's contents **/
{
THPrint prInfoHndl;
Boolean dirty;
Boolean hasRealName;
Boolean hasBackGround;
Boolean isArmed;
short targets_left;
short armament_type; /* 0 = guns, 1 = guns & missles, 2 = guns, missles & neutron bomb */
short arms_selected; /* 0 = guns, 1 = missles, 2 = neutron bomb */
Boolean hasTargets;
SFReply findFile;
Point scrollAmount;
ControlHandle myVCntrlHdl; /* verticle scroll bar */
ControlHandle myHCntrlHdl; /* horizontal scroll bar */
short vDocLimit;
short hDocLimit;
TPrint printInfo;
short paletteSetting;
short vPtNo;
long focalLn;
long xvPt;
long yvPt;
short focalPtNo;
short isPrey;
struct _3dPtStrk_BG gXYZplane;
objectDescr_BG bg_object[22]; /* 22 is OK */
objectDescr object[MAX_OBJECTS]; /* objDescr */ /* MAX_OBJECTS happens to be 30 */
} WObjs, **WObjsHandle;
/****************************************************/
if(PreyMenu != NIL)
{
pred_hndl = (predDataHndl)NewHandle(sizeof(predData));
(**pred_hndl).object[1] = (**w_objs_hndl).object[n];
(**pred_hndl).type = type;
(**pred_hndl).hasBackGround = (**w_objs_hndl).hasBackGround;
(**pred_hndl).isArmed = (**w_objs_hndl).isArmed;
(**pred_hndl).targets_left = (**w_objs_hndl).targets_left;
(**pred_hndl).armament_type = (**w_objs_hndl).armament_type;
(**pred_hndl).arms_selected = (**w_objs_hndl).arms_selected;
(**pred_hndl).hasTargets = (**w_objs_hndl).hasTargets;
}